
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpInfoParam.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpInfoParamForm"
 */
public class CcpInfoParamForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cfpGuid = null;
   private java.lang.String _cfbLabel = null;
   private java.lang.String _isDicvalue = null;
   private java.lang.String _paramName = null;
   private java.lang.String _paramValue = null;
   private java.lang.String _isUsed = null;
   private java.lang.String _colAttri = null;

   /**
    * Standard constructor.
    */
   public CcpInfoParamForm() {
   }

   /**
    * Returns the cfpGuid
    *
    * @return the cfpGuid
    */
   public java.lang.String getCfpGuid() {
      return _cfpGuid;
   }

   /**
    * Sets the cfpGuid
    *
    * @param cfpGuid the new cfpGuid value
    */
   public void setCfpGuid(java.lang.String cfpGuid) {
      _cfpGuid = cfpGuid;
   }
   /**
    * Returns the cfbLabel
    *
    * @return the cfbLabel
    */
   public java.lang.String getCfbLabel() {
      return _cfbLabel;
   }

   /**
    * Sets the cfbLabel
    *
    * @param cfbLabel the new cfbLabel value
    */
   public void setCfbLabel(java.lang.String cfbLabel) {
      _cfbLabel = cfbLabel;
   }
   /**
    * Returns the isDicvalue
    *
    * @return the isDicvalue
    */
   public java.lang.String getIsDicvalue() {
      return _isDicvalue;
   }

   /**
    * Sets the isDicvalue
    *
    * @param isDicvalue the new isDicvalue value
    */
   public void setIsDicvalue(java.lang.String isDicvalue) {
      _isDicvalue = isDicvalue;
   }
   /**
    * Returns the paramName
    *
    * @return the paramName
    */
   public java.lang.String getParamName() {
      return _paramName;
   }

   /**
    * Sets the paramName
    *
    * @param paramName the new paramName value
    */
   public void setParamName(java.lang.String paramName) {
      _paramName = paramName;
   }
   /**
    * Returns the paramValue
    *
    * @return the paramValue
    */
   public java.lang.String getParamValue() {
      return _paramValue;
   }

   /**
    * Sets the paramValue
    *
    * @param paramValue the new paramValue value
    */
   public void setParamValue(java.lang.String paramValue) {
      _paramValue = paramValue;
   }
   /**
    * Returns the isUsed
    *
    * @return the isUsed
    */
   public java.lang.String getIsUsed() {
      return _isUsed;
   }

   /**
    * Sets the isUsed
    *
    * @param isUsed the new isUsed value
    */
   public void setIsUsed(java.lang.String isUsed) {
      _isUsed = isUsed;
   }
   /**
    * Returns the colAttri
    *
    * @return the colAttri
    */
   public java.lang.String getColAttri() {
      return _colAttri;
   }

   /**
    * Sets the colAttri
    *
    * @param colAttri the new colAttri value
    */
   public void setColAttri(java.lang.String colAttri) {
      _colAttri = colAttri;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCfpGuid() == null) {
         errors.add("cfpGuid", new ActionError("error.cfpGuid.required"));
      }
      if(getIsDicvalue() == null) {
         errors.add("isDicvalue", new ActionError("error.isDicvalue.required"));
      }
      if(getParamName() == null) {
         errors.add("paramName", new ActionError("error.paramName.required"));
      }
      // TODO test format/data
      return errors;
   }
}
